<template>
    <div class="back-top" @click="backtop">
        <div class="back-top-wrap">
            <i class="iconfont icon-shang"></i>
        </div>
    </div>
</template>
<script>
    export default{
        name:"backTop",
        data(){
            return {

            }
        },
        methods:{
            backtop(){
                document.documentElement.scrollTop = 0
            }
        }
    }
</script>
<style scoped>
.back-top-wrap{
    position:fixed;
    right:0;
    margin-right:70px;
    bottom:100px;
    width:42px;
    height:42px;
    line-height:42px;
    text-align:center;
    border-radius:50%;
    background-color:rgb(255,255,255);
    box-shadow:0 1px 5px 0;
    transition:background-color .3s,color .3s;
}
.back-top-wrap:hover{
    cursor:pointer;
    background-color:#007fff;
    color:#fff;
    box-shadow:#3780f7 0 1px 5px 0;
}
.iconfont.icon-shang{
    font-size:20px;
}
</style>